import Api from '../../../../utils/httpImpl';
const api = new Api();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    subjectList: [],
  },
  onShow() {
    this.getData();
  },
  async getData() {
    const result = await api.getSubject();
    this.setData({
      subjectList: result.subjects
    });
    console.log(result);
  },
  //去获取章节
  toChapter(e) {
    let _id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/basics/title/chapter/chapter?id=${_id}`,
    });
  }
})